package org.aceor.mddal.config.sharding;

import com.google.common.base.Objects;

import java.util.Map;

/**
 * Created by lxue on 16/3/26.
 */
public class LogicTable {
    /**
     * key:表名
     * value:分库分表规则
     */
    private Map<String, TableRule> tableRules;

    /**
     * 不分库时默认的dbGroupKey
     */
    private String defaultDbIndex;

    public Map<String, TableRule> getTableRules() {
        return tableRules;
    }

    public void setTableRules(Map<String, TableRule> tableRules) {
        this.tableRules = tableRules;
    }

    public String getDefaultDbIndex() {
        return defaultDbIndex;
    }

    public void setDefaultDbIndex(String defaultDbIndex) {
        this.defaultDbIndex = defaultDbIndex;
    }


    @Override
    public String toString() {
        return Objects.toStringHelper(this)
                .add("defaultDbIndex",defaultDbIndex)
                .add("tableRules",tableRules)
                .toString();
    }
}
